package com.jrx.anytxn.investor.service;

import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.customer.dto.customer.CustomerRes;
import com.jrx.anytxn.investor.bean.InvestorCreditBean;
import com.jrx.anytxn.investor.entity.TlCustomerInvestorLimit;
import com.jrx.anytxn.investor.entity.TlInvestorLimitApproveLog;

import java.util.List;

/**
 * 客户出资方授信额度Service接口
 *
 * @author liuyang
 * @date 2020-06-09
 */
public interface IInvestorCustomerLimitService {

    /**
     * 构建客户出资方授信额度
     *
     * @param investorCreditBean 联合贷授信bean
     * @param investorId 出资方id
     * @return TlCustomerInvestorLimit 客户出资方授信额度
     * @throws TxnBizException
     * @author liuyang
     * @date 2020-06-09
     */
    TlCustomerInvestorLimit buildCustomerInvestorLimit(InvestorCreditBean investorCreditBean, String investorId) throws TxnBizException;

    /**
     * 构建客户出资方授信审批记录
     *
     * @param investorCreditBean 联合贷授信bean
     * @param investorId 出资方id
     * @param customerRes 客户信息
     * @param approveStatus 审批状态
     * @return TlInvestorLimitApproveLog 客户出资方授信额度
     * @throws TxnBizException
     * @author liuyang
     * @date 2020-06-09
     */
    TlInvestorLimitApproveLog buildInvestorLimitApproveLog(InvestorCreditBean investorCreditBean, String investorId, CustomerRes customerRes, String approveStatus) throws TxnBizException;

    /**
     * 根据客户id和出资方id查询客户出资方授信额度
     *
     * @param customerId 客户id
     * @param investorId 出资方id
     * @param tenantId 租户ID
     * @param statusList 状态
     * @return TlCustomerInvestorLimit 客户出资方授信额度
     * @throws TxnBizException
     * @author liuyang
     * @date  2020-06-09
     */
    List<TlCustomerInvestorLimit> findByCustomerIdAndInvestorId(String customerId, String investorId, String tenantId, List<String> statusList) throws TxnBizException;

    /**
     * 构建客户出资方授信额度
     *
     * @param investorLimitApproveLog 授信审批记录
     * @return TlCustomerInvestorLimit 客户出资方授信额度
     * @throws TxnBizException
     * @author liuyang
     * @date 2020-06-17
     */
    TlCustomerInvestorLimit buildCustomerInvestorLimit(TlInvestorLimitApproveLog investorLimitApproveLog) throws TxnBizException;
}
